package com.example.live;


import com.example.live.config.MyBatisPlusConfig;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.JdbcType;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.time.LocalDateTime;

/**
 * @author:zhuzewen
 * @data:2024/12/16 0016 11:29
 */
@SpringBootApplication

public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        SqlSessionFactory bean = run.getBean(SqlSessionFactory.class);
        bean.getConfiguration().getTypeHandlerRegistry().register(LocalDateTime.class, JdbcType.TIMESTAMP, new MyBatisPlusConfig.LocalDateTimeTypeHandler());

    }
}
